package com.principle.other;

/**
 * @author 冯志立
 * @create 2019-10-12 10:58
 */
public class SingleResponsibility {
    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle();
        vehicle.run("摩托车");
        vehicle.run("汽车");
        vehicle.run("飞机");
    }
}

//交通工具类
//方式1
 class Vehicle {
    public void run(String vehicle){
        System.out.println(vehicle + "在公路上奔跑.....");
    }
 }